import Vuex from 'vuex'
import Vue from 'vue'
Vue.use(Vuex)
export default new Vuex.Store({
	state: {
		complateTask: null,
		userInfo:null,
		config: null,
		// config: localStorage.getItem('config') || null
	},
	mutations: {
		setComplateTask (state, data) {
			state.complateTask = data
		},
		setUser(state,info){
			state.userInfo = JSON.parse(JSON.stringify(info))
			localStorage.setItem('userInfo',JSON.stringify(info))
		},
		setConfig(state, data) {
			state.config = JSON.parse(JSON.stringify(data))
			localStorage.setItem('config', JSON.stringify(data))
		}
	}
})